


def assert_equal(actual, expected, msg=None):
    try:
        assert actual == expected
    except AssertionError:
        if msg:
            raise AssertionError(f"{msg} | Actual: {actual} | Expected: {expected}")
        else:
            raise AssertionError(f"Actual: {actual} | Expected: {expected}")



def assert_status_code(actual, expected):
    assert actual == expected, f"Expected status {expected}, got {actual}"

def assert_db_record(db, sql, expected):
    record = db.query_one(sql)
    assert record == expected, f"DB record mismatch: {record}"


